<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>个人中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="stylesheet" href="../css/mui.min.css">
    <link rel="stylesheet" href="../css/iconfont.css" />
    <link rel="stylesheet" href="../css/user.css">

    <style>
body{
    margin: 0px;
}
    </style>

</head>

<body class="mui-fullscreen">
<!--页面主结构开始-->

<div id="app" class="mui-views">

    <div class="mui-pages" style="top: 0px!important;">
    </div>
</div>
<!--页面主结构结束-->
<!--单页面开始-->
<div id="setting" class="mui-page">
    <div class="mui-page-content">
        <div class="mui-scroll-wrapper">
            <div class="mui-scroll">
                <div class=" bgblue userheader usershezhi">
                    <div class="usershezhi">
                        <a href="#" class="mui-pull-right topchilun"></a>
                    </div>
                    <ul class="mui-table-view bgnone userinfo">
                        <li class="mui-table-view-cell mui-media userinfoin">
                            <div class="mui-media-object mui-pull-left userinfoinimg"> <img src="../images/L8AAg1mQ81vlQ58AAAAASUVORK5CYII=.png" id="avatar"></div>
                            <div class="mui-media-body">

                                    <p class="userinfonh" id="name"></p>
                                    <p class='mui-ellipsis userinfot' id="mobile"></p>


                            </div>
                        </li>

                    </ul>
                </div>

                <ul class="mui-table-view mui-table-view-chevron">
                    <li class="mui-table-view-cell">

                        <a href="userdetails.html" class="mui-navigate-right"><img src="../images/home/管理员%20(2).png"style="width: 21px; margin-right: 16px;"/>会员中心</a>
                    </li>

                    <li class="mui-table-view-cell">
                        <a href="userfree.html" class="mui-navigate-right"><img src="../images/setting/3.png" style="width: 21px;margin-right: 16px;"/>免费测斑结果</a>
                    </li>
                </ul>
                <ul class="mui-table-view mui-table-view-chevron">
                    <li class="mui-table-view-cell">
                        <a href="userjubuorder.html?typedata=1" class="mui-navigate-right"><img src="../images/setting/2.png" style="width: 21px;margin-right: 16px;"/>局部体验订单</a>
                    </li>
                    <li class="mui-table-view-cell">
                        <a href="userqianyuorder.html?typedata=3" class="mui-navigate-right"><img src="../images/setting/6.png" style="width: 21px;margin-right: 16px;"/>签约祛斑订单</a>
                    </li>
                    <li class="mui-table-view-cell">
                        <a href="useragentlist.html?typedata=5" class="mui-navigate-right"><img src="../images/setting/23Ljv1mAAAAAElFTkSuQmCC.png" style="width: 21px;margin-right: 16px;"/>
                           代理审核
                        </a>
                    </li>

                </ul>
                <ul class="mui-table-view mui-table-view-chevron" id="agentshow" style="display: none">
                    <li class="mui-table-view-cell">
                        <a href="agentuser.html" class="mui-navigate-right"><img src="../images/setting/nmPOt4V6XqGZ9oAAAAASUVORK5CYII=.png" style="width: 21px;margin-right: 16px;"/>经纪人中心</a>
                    </li>
                </ul>
                <ul class="mui-table-view mui-table-view-chevron" id="adminshow" style="display: none">
                    <li class="mui-table-view-cell">
                        <a href="admin.html" class="mui-navigate-right"><img src="../images/setting/nmPOt4V6XqGZ9oAAAAASUVORK5CYII=.png" style="width: 21px;margin-right: 16px;"/>管理员中心</a>
                    </li>

                </ul>
            </div>
        </div>
    </div>
    <!--页面主内容区结束-->
</div>

<div class="footerpage">
</div>
</body>
<script src="../js/mui.min.js"></script>
<script src="../js/mui.view.js"></script>
<script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/cookieutil.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/page/getuserBylogin.js"></script>
<script src="../js/getUrlParam.js"></script>
<script>
    geturlid();
    $(".footerpage").load("footer.html");
    //初始化单页view
    var viewApi = mui('#app').view({
        defaultPage: '#setting'
    });
    var  userid=getCookie('userid');
    var isadmin =getCookie('isadmin');
    var level =getCookie('level');
    if (isadmin=="1"&&isadmin!=undefined&&isadmin!=""&&isadmin!=null){

        var adminshow = document.getElementById('adminshow');
        adminshow.style.display="block";
    }
    if (level>1){
        var agentshow = document.getElementById('agentshow');
        agentshow.style.display="block";
    }
    else {
        mui.post('/Order/findUserId', {userid: userid.toString(), typedata: "5"}, function (info) {
            console.log(info);
            //状态:0=未付款,1=已付款待确认,2=已确认待完成,3=已完成待支付尾款,4=待审核,5=完成,6=已升级
            if (!info.code||info.object==null) {
                //window.location.href = "addagent.html";
            } else {
                var datas = info.object[0];
                if (datas.statustype == 0) {
                    mui.toast('已申请未付款，请到个人中心查看。');
                }
                if (datas.statustype == 4) {
                    mui.toast('你的申请还没有审核..');
                }
                if (datas.statustype == 5) {
                    window.location.href = "agentuser.html";
                 }
            }
        });
    }
    if (userid==null||userid==undefined)
    {
        geturlid();
    }
    else {
        var username2=getCookie('username');
        var o = document.getElementById('name');
        o.innerHTML=username2;
        var  avatar=getCookie('avatar');
        // var avatar = document.getElementById("avatar");
        // avatar.src = avatar//改变内容
        $("#avatar").attr('src',avatar);
        var  mobile2=getCookie('mobile');
        var mobile = document.getElementById('mobile');
        mobile.innerHTML=mobile2;
    }
</script>

</html>